/**
 * Created by gongxun on 17/3/16.
 */

var PszTableRuleLayer = GameCCSBase.extend({
    ctor: function () {
        this._super();
        this.loadCocostudio("res/ccs/PszTableRule.json");

        //button
        mo.seekWidgetByName(this.ccsNode, "Panel_touch").addTouchEventListener(function (sender, type) {
            if (mo.gameHelper.getIsTouchEnd(type)) {
                this.setClose();
            }
        }, this);

        //button
        mo.seekWidgetByName(this.ccsNode, "Button_close").addTouchEventListener(function (sender, type) {
            if (mo.gameHelper.getIsTouchEnd(type)) {
                this.setClose();
            }
        }, this);
    },

    onEnter: function () {
        this._super();
        this.showAction(mo.seekWidgetByName(this.ccsNode, "Panel_center"));
    },

    onExit: function () {
        this._super();
    },

    setClose : function(){
        this.removeFromParent();
        return true;
    }
});